DROP TABLE IF EXISTS `_DBPREFIX_module`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_module` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `gid` int(11) NOT NULL,
  `name` varchar(32) NOT NULL,
  `title` varchar(64) NOT NULL,
  `tbname` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `_DBPREFIX_group`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `title` varchar(64) NOT NULL,
  `code` varchar(32) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

DROP TABLE IF EXISTS `_DBPREFIX_actions`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_actions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `title` varchar(32) NOT NULL,
  `group` varchar(16) NOT NULL,
  `mod` varchar(16) NOT NULL,
  `ac` varchar(16) NOT NULL,
  `moid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS `_DBPREFIX_table_filed`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_table_filed` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mod` varchar(16) NOT NULL,
  `title` varchar(32) NOT NULL,
  `fname` varchar(16) NOT NULL,
  `attr` varchar(12) NOT NULL,
  `cls` varchar(16) NOT NULL,
  `val` varchar(32) NOT NULL,
  `tips` varchar(16) NOT NULL,
  `dicid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS `_DBPREFIX_menu`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group` varchar(16) NOT NULL,
  `mod` varchar(16) NOT NULL,
  `name` varchar(16) NOT NULL,
  `is_show` tinyint(4) NOT NULL DEFAULT '1',
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `pid` mediumint(9) NOT NULL,
  `idx` smallint(6) NOT NULL,
  `url` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS `_DBPREFIX_dic_type`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_dic_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(16) NOT NULL,
  `code` varchar(12) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS `_DBPREFIX_dic`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_dic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dicid` int(11) NOT NULL,
  `name` varchar(16) NOT NULL,
  `value` varchar(16) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS `_DBPREFIX_role`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(16) NOT NULL,
  `code` varchar(12) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS `_DBPREFIX_role_menu`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_role_menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `menuid` int(11) NOT NULL,
  `rid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS `_DBPREFIX_role_permission`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_role_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rid` int(11) NOT NULL,
  `name` varchar(32) NOT NULL,
  `group` varchar(32) NOT NULL,
  `mod` varchar(32) NOT NULL,
  `ac` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


DROP TABLE IF EXISTS `_DBPREFIX_member`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_member` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `account` varchar(16) NOT NULL,
  `name` varchar(12) NOT NULL,
  `password` varchar(32) NOT NULL,
  `email` varchar(16) NOT NULL,
  `mobile` varchar(15) NOT NULL,
  `idcard` varchar(15) NOT NULL,
  `position` varchar(16) NOT NULL COMMENT '职位',
  `cert` int(11) NOT NULL COMMENT '证书',
  `depid` int(11) NOT NULL COMMENT '部门',
  `no` varchar(16) NOT NULL COMMENT '工号',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `_DBPREFIX_member_role`;
CREATE TABLE IF NOT EXISTS `_DBPREFIX_member_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rid` int(11) NOT NULL,
  `mid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

INSERT INTO `_DBPREFIX_member` (`id`, `account`, `name`, `password`, `email`, `mobile`, `idcard`, `position`, `cert`, `depid`, `no`) VALUES
(1, 'admin', '管理员', 'd41d8cd98f00b204e9800998ecf8427e', '', '', '', '', 0, 0, '');